package com.boarsoft.log.core;

import java.io.IOException;
import java.io.ObjectOutput;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SampleLogSender {
	private static final Logger log = LoggerFactory.getLogger(SampleLogSender.class);

	protected static ObjectOutput sender;

	public static void send(Map<String, Object> map) throws IOException {
		if (SampleLogSender.sender == null) {
			log.warn("SampleLogSender.sender is required");
			return;
		}
		sender.writeObject(map); // 参见Messenger的实现
	}

	public void setSender(ObjectOutput sender) {
		SampleLogSender.sender = sender;
	}

	public ObjectOutput getSender() {
		return SampleLogSender.sender;
	}
}
